home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13646 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  1.7 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news text default
99% file C++ source, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 6e 65 | 77 73 2e 72 61 69 6e 2e |Path: ne|ws.rain.|
|00000010| 6f 72 67 21 75 73 65 6e | 65 74 0a 46 72 6f 6d 3a |org!usen|et.From:|
|00000020| 20 22 47 75 75 73 20 4c | 65 65 75 77 20 6a 72 2e | "Guus L|eeuw jr.|
|00000030| 22 20 3c 67 75 75 73 6c | 40 65 69 66 66 65 6c 2e |" <guusl|@eiffel.|
|00000040| 63 6f 6d 3e 0a 4e 65 77 | 73 67 72 6f 75 70 73 3a |com>.New|sgroups:|
|00000050| 20 63 6f 6d 70 2e 6c 61 | 6e 67 2e 63 2b 2b 0a 53 | comp.la|ng.c++.S|
|00000060| 75 62 6a 65 63 74 3a 20 | 52 65 3a 20 6d 75 74 75 |ubject: |Re: mutu|
|00000070| 61 6c 20 64 61 74 61 20 | 73 74 72 75 63 74 75 72 |al data |structur|
|00000080| 65 73 0a 44 61 74 65 3a | 20 54 75 65 2c 20 32 36 |es.Date:| Tue, 26|
|00000090| 20 4d 61 72 20 31 39 39 | 36 20 31 33 3a 32 30 3a | Mar 199|6 13:20:|
|000000a0| 31 34 20 2d 30 38 30 30 | 0a 4f 72 67 61 6e 69 7a |14 -0800|.Organiz|
|000000b0| 61 74 69 6f 6e 3a 20 49 | 6e 74 65 72 61 63 74 69 |ation: I|nteracti|
|000000c0| 76 65 20 53 6f 66 74 77 | 61 72 65 20 45 6e 67 69 |ve Softw|are Engi|
|000000d0| 6e 65 65 72 69 6e 67 20 | 49 6e 63 2e 20 68 74 74 |neering |Inc. htt|
|000000e0| 70 3a 2f 2f 77 77 77 2e | 65 69 66 66 65 6c 2e 63 |p://www.|eiffel.c|
|000000f0| 6f 6d 2f 0a 4d 65 73 73 | 61 67 65 2d 49 44 3a 20 |om/.Mess|age-ID: |
|00000100| 3c 33 31 35 38 35 46 38 | 45 2e 31 43 41 35 45 31 |<31585F8|E.1CA5E1|
|00000110| 46 40 65 69 66 66 65 6c | 2e 63 6f 6d 3e 0a 52 65 |F@eiffel|.com>.Re|
|00000120| 66 65 72 65 6e 63 65 73 | 3a 20 3c 34 6a 31 6d 75 |ferences|: <4j1mu|
|00000130| 31 24 66 61 73 40 62 61 | 73 6b 65 72 76 69 6c 6c |1$fas@ba|skervill|
|00000140| 65 2e 43 53 2e 41 72 69 | 7a 6f 6e 61 2e 45 44 55 |e.CS.Ari|zona.EDU|
|00000150| 3e 0a 4e 4e 54 50 2d 50 | 6f 73 74 69 6e 67 2d 48 |>.NNTP-P|osting-H|
|00000160| 6f 73 74 3a 20 40 6f 75 | 74 62 61 63 6b 2e 65 69 |ost: @ou|tback.ei|
|00000170| 66 66 65 6c 2e 63 6f 6d | 0a 4d 69 6d 65 2d 56 65 |ffel.com|.Mime-Ve|
|00000180| 72 73 69 6f 6e 3a 20 31 | 2e 30 0a 43 6f 6e 74 65 |rsion: 1|.0.Conte|
|00000190| 6e 74 2d 54 79 70 65 3a | 20 74 65 78 74 2f 70 6c |nt-Type:| text/pl|
|000001a0| 61 69 6e 3b 20 63 68 61 | 72 73 65 74 3d 75 73 2d |ain; cha|rset=us-|
|000001b0| 61 73 63 69 69 0a 43 6f | 6e 74 65 6e 74 2d 54 72 |ascii.Co|ntent-Tr|
|000001c0| 61 6e 73 66 65 72 2d 45 | 6e 63 6f 64 69 6e 67 3a |ansfer-E|ncoding:|
|000001d0| 20 37 62 69 74 0a 58 2d | 4d 61 69 6c 65 72 3a 20 | 7bit.X-|Mailer: |
|000001e0| 4d 6f 7a 69 6c 6c 61 20 | 32 2e 30 20 28 58 31 31 |Mozilla |2.0 (X11|
|000001f0| 3b 20 49 3b 20 4c 69 6e | 75 78 20 31 2e 32 2e 38 |; I; Lin|ux 1.2.8|
|00000200| 20 69 35 38 36 29 0a 54 | 6f 3a 20 4b 6f 65 6e 20 | i586).T|o: Koen |
|00000210| 44 65 20 42 6f 73 73 63 | 68 65 72 65 20 3c 6b 64 |De Bossc|here <kd|
|00000220| 62 40 43 53 2e 41 72 69 | 7a 6f 6e 61 2e 45 44 55 |b@CS.Ari|zona.EDU|
|00000230| 3e 0a 0a 4b 6f 65 6e 20 | 44 65 20 42 6f 73 73 63 |>..Koen |De Bossc|
|00000240| 68 65 72 65 20 77 72 6f | 74 65 3a 0a 3e 20 0a 0a |here wro|te:.> ..|
|00000250| 5b 73 6e 69 70 20 73 6e | 69 70 5d 0a 0a 3e 20 0a |[snip sn|ip]..> .|
|00000260| 3e 20 54 68 65 20 70 72 | 6f 62 6c 65 6d 20 69 73 |> The pr|oblem is|
|00000270| 20 74 68 61 74 20 69 6e | 20 6f 72 64 65 72 20 74 | that in| order t|
|00000280| 6f 20 63 72 65 61 74 65 | 20 74 79 70 65 64 20 70 |o create| typed p|
|00000290| 6f 69 6e 74 65 72 73 2c | 20 49 0a 3e 20 6e 65 65 |ointers,| I.> nee|
|000002a0| 64 20 74 68 65 20 64 65 | 66 69 6e 69 74 69 6f 6e |d the de|finition|
|000002b0| 20 6f 66 20 74 68 65 20 | 63 6c 61 73 73 2c 20 61 | of the |class, a|
|000002c0| 6e 64 20 6e 6f 20 6d 61 | 74 74 65 72 20 68 6f 77 |nd no ma|tter how|
|000002d0| 20 49 20 72 65 6f 72 64 | 65 72 0a 3e 20 74 68 65 | I reord|er.> the|
|000002e0| 20 63 6c 61 73 73 20 64 | 65 66 69 6e 69 74 69 6f | class d|efinitio|
|000002f0| 6e 73 2c 20 74 68 65 72 | 65 20 77 69 6c 6c 20 61 |ns, ther|e will a|
|00000300| 6c 77 61 79 73 20 62 65 | 20 61 6e 20 75 6e 64 65 |lways be| an unde|
|00000310| 66 69 6e 65 64 0a 3e 20 | 63 6c 61 73 73 20 61 74 |fined.> |class at|
|00000320| 20 73 6f 6d 65 20 70 6f | 69 6e 74 2e 0a 3e 20 0a | some po|int..> .|
|00000330| 3e 20 63 6c 61 73 73 20 | 6e 6f 64 65 31 20 7b 0a |> class |node1 {.|
|00000340| 3e 20 2e 2e 2e 2e 0a 3e | 20 6e 6f 64 65 32 20 2a |> .....>| node2 *|
|00000350| 70 6f 69 6e 74 65 72 3b | 20 20 20 2f 2f 20 6e 6f |pointer;| // no|
|00000360| 64 65 32 20 75 6e 64 65 | 66 69 6e 65 64 20 61 74 |de2 unde|fined at|
|00000370| 20 74 68 69 73 20 70 6f | 69 6e 74 0a 3e 20 2e 2e | this po|int.> ..|
|00000380| 2e 2e 0a 3e 20 7d 3b 0a | 3e 20 0a 3e 20 63 6c 61 |...> };.|> .> cla|
|00000390| 73 73 20 6e 6f 64 65 32 | 20 7b 0a 3e 20 2e 2e 2e |ss node2| {.> ...|
|000003a0| 2e 0a 3e 20 6e 6f 64 65 | 31 20 2a 70 6f 69 6e 74 |..> node|1 *point|
|000003b0| 65 72 3b 0a 3e 20 2e 2e | 2e 2e 0a 3e 20 7d 3b 0a |er;.> ..|...> };.|
|000003c0| 3e 20 0a 3e 20 49 20 77 | 61 73 20 77 6f 6e 64 65 |> .> I w|as wonde|
|000003d0| 72 69 6e 67 20 77 68 65 | 74 68 65 72 20 74 68 65 |ring whe|ther the|
|000003e0| 72 65 20 69 73 20 61 6e | 20 65 6c 65 67 61 6e 74 |re is an| elegant|
|000003f0| 20 73 6f 6c 75 74 69 6f | 6e 0a 3e 20 66 6f 72 20 | solutio|n.> for |
|00000400| 74 68 69 73 20 6b 69 6e | 64 20 6f 66 20 70 72 6f |this kin|d of pro|
|00000410| 62 6c 65 6d 2e 20 54 68 | 69 73 20 6b 69 6e 64 20 |blem. Th|is kind |
|00000420| 6f 66 20 64 61 74 61 20 | 73 74 72 75 63 74 75 72 |of data |structur|
|00000430| 65 0a 3e 20 63 61 6e 6e | 6f 74 20 62 65 20 73 6f |e.> cann|ot be so|
|00000440| 20 75 6e 75 73 75 61 6c | 2c 20 73 6f 20 6f 74 68 | unusual|, so oth|
|00000450| 65 72 20 70 65 6f 70 6c | 65 20 6d 75 73 74 20 68 |er peopl|e must h|
|00000460| 61 76 65 20 66 61 63 65 | 64 0a 3e 20 74 68 69 73 |ave face|d.> this|
|00000470| 20 70 72 6f 62 6c 65 6d | 20 62 65 66 6f 72 65 2e | problem| before.|
|00000480| 0a 3e 20 0a 0a 41 73 20 | 6c 6f 6e 67 20 61 73 20 |.> ..As |long as |
|00000490| 79 6f 75 20 73 74 69 63 | 6b 20 77 69 74 68 20 70 |you stic|k with p|
|000004a0| 6f 69 6e 74 65 72 73 20 | 74 6f 20 6f 62 6a 65 63 |ointers |to objec|
|000004b0| 74 73 2c 20 79 6f 75 20 | 63 61 6e 20 69 6e 73 65 |ts, you |can inse|
|000004c0| 72 74 20 61 20 66 6f 72 | 77 61 72 64 0a 64 65 63 |rt a for|ward.dec|
|000004d0| 6c 61 72 61 74 69 6f 6e | 20 6f 66 20 65 69 74 68 |laration| of eith|
|000004e0| 65 72 20 6f 66 20 74 68 | 65 20 63 6c 61 73 73 65 |er of th|e classe|
|000004f0| 73 3a 0a 0a 60 63 6c 61 | 73 73 20 6e 6f 64 65 32 |s:..`cla|ss node2|
|00000500| 3b 27 0a 0a 54 68 69 73 | 20 6c 65 74 73 20 74 68 |;'..This| lets th|
|00000510| 65 20 63 6f 6d 70 69 6c | 65 72 20 6b 6e 6f 77 20 |e compil|er know |
|00000520| 74 68 65 20 6e 6f 64 65 | 32 20 69 73 20 74 6f 20 |the node|2 is to |
|00000530| 62 65 20 64 65 66 69 6e | 65 64 20 70 72 65 74 74 |be defin|ed prett|
|00000540| 79 20 73 6f 6f 6e 2e 20 | 4e 6f 77 0a 79 6f 75 20 |y soon. |Now.you |
|00000550| 63 61 6e 20 75 73 65 20 | 70 6f 69 6e 74 65 72 73 |can use |pointers|
|00000560| 20 74 6f 20 6f 62 6a 65 | 63 74 73 20 6f 66 20 74 | to obje|cts of t|
|00000570| 68 61 74 20 74 79 70 65 | 2e 20 4e 6f 74 65 20 74 |hat type|. Note t|
|00000580| 68 61 74 20 79 6f 75 20 | 63 61 6e 6e 6f 74 20 75 |hat you |cannot u|
|00000590| 73 65 0a 6f 62 6a 65 63 | 74 73 20 6f 66 20 74 79 |se.objec|ts of ty|
|000005a0| 70 65 2c 20 62 65 63 61 | 75 73 65 20 74 68 65 20 |pe, beca|use the |
|000005b0| 74 79 70 65 20 69 73 20 | 6e 6f 74 20 64 65 66 69 |type is |not defi|
|000005c0| 6e 65 64 20 79 65 74 2e | 0a 0a 53 6f 20 74 68 65 |ned yet.|..So the|
|000005d0| 20 63 6f 64 65 20 73 68 | 6f 75 6c 64 20 6c 6f 6f | code sh|ould loo|
|000005e0| 6b 20 6c 69 6b 65 3a 0a | 0a 63 6c 61 73 73 20 6e |k like:.|.class n|
|000005f0| 6f 64 65 32 3b 09 2f 2f | 20 46 6f 72 77 61 72 64 |ode2;.//| Forward|
|00000600| 20 64 65 63 6c 61 72 61 | 74 69 6f 6e 20 6f 66 20 | declara|tion of |
|00000610| 63 6c 61 73 73 20 6e 6f | 64 65 32 0a 0a 63 6c 61 |class no|de2..cla|
|00000620| 73 73 20 6e 6f 64 65 31 | 0a 7b 0a 20 20 6e 6f 64 |ss node1|.{. nod|
|00000630| 65 32 20 2a 78 3b 09 2f | 2f 20 50 6f 69 6e 74 65 |e2 *x;./|/ Pointe|
|00000640| 72 20 75 73 61 67 65 20 | 61 6c 6c 6f 77 65 64 3a |r usage |allowed:|
|00000650| 20 63 6c 61 73 73 20 6e | 61 6d 65 20 69 73 20 6b | class n|ame is k|
|00000660| 6e 6f 77 6e 2c 20 74 68 | 6f 75 67 68 0a 09 09 2f |nown, th|ough.../|
|00000670| 2f 20 74 68 65 20 64 65 | 66 69 6e 69 74 69 6f 6e |/ the de|finition|
|00000680| 20 68 61 73 20 73 74 69 | 6c 6c 20 74 6f 20 63 6f | has sti|ll to co|
|00000690| 6d 65 0a 7d 3b 0a 0a 63 | 6c 61 73 73 20 6e 6f 64 |me.};..c|lass nod|
|000006a0| 65 32 0a 7b 0a 20 20 6e | 6f 64 65 31 20 2a 79 3b |e2.{. n|ode1 *y;|
|000006b0| 09 2f 2f 20 4e 6f 20 70 | 72 6f 62 6c 65 6d 20 61 |.// No p|roblem a|
|000006c0| 74 20 61 6c 6c 2e 0a 7d | 3b 0a 0a 52 65 67 61 72 |t all..}|;..Regar|
|000006d0| 64 73 2c 0a 09 47 75 75 | 73 0a |ds,..Guu|s. |
+--------+-------------------------+-------------------------+--------+--------+